package ludowork.components;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import ludowork.core.ImageSource;
import ludowork.core.Manager;
import ludowork.core.VisorPlugin;

public class PluginActionListener implements ActionListener {

    public PluginActionListener(VisorPlugin imageSource) {
        this.plugin = imageSource;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        int execStatus = plugin.exec();
        switch (execStatus) {
            case Manager.SUCCESS:
                //Manager.getManager().setImageSource(plugin);
                break;
            case Manager.FAILED:
                Manager.getManager().getLogger().addLine("Image source execution failed");
                break;
            case Manager.CANCELED:
                break;
        }

    } 
   private VisorPlugin plugin;
}
